Direct Boolean Expressions
The boolean symbols '&', '|', and '~' which stand for 'AND', 'OR', and 'NOT' can be used directly in the Search For: field in the main dialog.
To use this function, disable Regular Expression, HTML mode, and Ignore Whitespace Mode if they are on and enable Whole Word mode. You can do this from the toolbar buttons or the Flags Menu. Case Sensitive can be on or not.
Notes:
Do not use the words 'AND', 'OR', or 'NOT'. Use the '&', '|', and '~' symbols.
Terms may be combined using ( ) characters.
~ terms should come last and should be surrounded by ( ) characters. In most cases you should surround the first part of your search with ( ) as well. See the example below.
Replacements can be done if you like. Please keep in mind that if you make replacements the same replacement string will be used in for each instance of a search hit.
Searches are 'whole word' searches, which means the string you provide surrounded by any of these characters (using the ASCII table):
<000> thru / : thru @ [ thru ` { thru ┐
For example, 'truck' does not find 'trucks' but it would find 'truck' in '/truck<cr>'.
The ( and ) characters have special meaning using this method and cannot be used as literal characters. Likewise, there is no escape (literal) for the '&', '|', and '~' characters. If your search requires literal &, |, ~, or ( ), use a script that has a complex Expression Evaluator term.
Spaces are interpreted literally. For example, 'find me' looks for that literal phrase, not the single words 'find' and 'me'.
Examples:
To find files that contain the words 'this' and 'that', use (don't include the S: part):
S: this&that
To find files that contain the words 'this' and 'that' or 'find me':
S: (this&that)|find me
To find files that contain the words 'trucks' or 'cars' or 'boats' but not if the words 'planes' or 'rockets' are present in the file:
S: (trucks|cars|boats)~(planes|rockets)
To find files that contain the words 'rocket ship' and 'that', where 'rocket ship' is possibly on two adjacent lines with no characters in between, enable 'Ignore Whitespace' and 'Whole Word' mode and search for:
S: (rocket ship)|that